package com.hxkj.client.service;

import com.hxkj.domain.po.Resources;
import com.hxkj.domain.po.Templet;
import com.hxkj.domain.po.TemplteTree;
import com.platform.common.domain.result.ResultMessageStruct;
import org.springframework.cloud.netflix.feign.FeignClient;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import com.platform.common.domain.result.ResultDataStruct;

import java.util.List;

/**
 * @author YAOSY
 * @create 2018年6月6日
 * @desc 模板对外接口
 **/

@FeignClient(name = "cms-management")
public interface TemplteServiceClient {


    /**
     * 新增模板
     *
     * @param templet 模板信息
     * @throws Exception
     */
    @RequestMapping(value = "/templet/saveContent", method = RequestMethod.POST,consumes = "application/json;charset=UTF-8")
    ResultDataStruct<Templet> saveContent(@RequestBody Templet templet) throws Exception;



    /**
     * 新增目录
     *
     * @param templet 目录信息
     * @throws Exception
     */
    @RequestMapping(value = "/templet/saveFolder", method = RequestMethod.POST,consumes = "application/json;charset=UTF-8")
    ResultDataStruct<Templet> saveFolder(@RequestBody Templet templet) throws Exception;


    /**
     * 获取模板功能树
     *
     * @param templet
     * @return
     * @throws Exception
     */
    @RequestMapping(value = "/templet/getTempletTree", method = RequestMethod.POST, consumes = "application/json;charset=UTF-8")
    ResultDataStruct<List<TemplteTree>> getTempletTree(@RequestBody Templet templet) throws Exception;


    /**
     * 删除模板
     *
     * @param templet 目录信息
     * @throws Exception
     */
    @RequestMapping(value = "/templet/remove", method = RequestMethod.POST,consumes = "application/json;charset=UTF-8")
    ResultMessageStruct remove(@RequestBody Templet templet) throws Exception;


    /**
     * 获取单条模板数据
     *
     * @param templet
     * @throws Exception
     */
    @RequestMapping(value = "/templet/get", method = RequestMethod.POST,consumes = "application/json;charset=UTF-8")
    ResultDataStruct get(@RequestBody Templet templet) throws Exception;


    /**
     * 保存单条模板文件
     *
     * @param templet
     * @throws Exception
     */
    @RequestMapping(value = "/templet/modify", method = RequestMethod.POST,consumes = "application/json;charset=UTF-8")
    ResultMessageStruct modify(@RequestBody Templet templet) throws Exception;


    /**
     * 模板上传
     *
     * @param templet
     * @throws Exception
     */
    @RequestMapping(value = "/templet/upload", method = RequestMethod.POST,consumes = "application/json;charset=UTF-8")
    ResultMessageStruct upload(@RequestBody Templet templet) throws Exception;

    /**
     * 模板列表下拉框
     *
     * @param templet
     * @throws Exception
     */
    @RequestMapping(value = "/templet/getTree", method = RequestMethod.POST,consumes = "application/json;charset=UTF-8")
    ResultDataStruct<List<TemplteTree>> getTree(@RequestBody Templet templet) throws Exception;

    /**
     * 模板上传后需要保存的信息
     *
     * @param templet
     * @throws Exception
     */
    @RequestMapping(value = "/templet/saveUploadContent", method = RequestMethod.POST,consumes = "application/json;charset=UTF-8")
    ResultDataStruct<Templet> saveUploadContent(@RequestBody Templet templet) throws Exception;


    /**
     * 切换模板
     *
     * @param templet
     * @throws Exception
     */
    @RequestMapping(value = "/templet/getAllTempletByTempletId", method = RequestMethod.POST,consumes = "application/json;charset=UTF-8")
    ResultMessageStruct getAllTempletByTempletId(@RequestBody Templet templet) throws Exception;


    /**
     * 获取单个模板
     *
     * @param templet
     * @return
     * @throws Exception
     */
    @RequestMapping(value = "/templet/getTemplet", method = RequestMethod.POST,consumes = "application/json;charset=UTF-8")
    Templet getTemplet(@RequestBody Templet templet);

    /**
    * @author Mr.zheng
    * @Description getTempletBySiteId 根据站点获取模板文件
    * @Date 10:02 2018/8/17
    * @Param [templet]
    * @return com.platform.common.domain.result.ResultDataStruct<java.util.List<com.hxkj.domain.po.Templet>>
    **/
    @RequestMapping(value = "/templet/getTempletBySiteId", method = RequestMethod.POST,consumes = "application/json;charset=UTF-8")
    ResultDataStruct<List<Templet>> getTempletBySiteId(@RequestBody Templet templet) throws Exception;


    /**
    * @author Mr.zheng
    * @Description modifyTempletMd5 修改添加模板文件的MD5值
    * @Date 10:17 2018/8/20
    * @Param [templet]
    * @return com.platform.common.domain.result.ResultMessageStruct
    **/
    @RequestMapping(value = "/templet/modifyTempletMd5", method = RequestMethod.POST,consumes = "application/json;charset=UTF-8")
    ResultMessageStruct modifyTempletMd5(@RequestBody Templet templet) throws Exception;


   /**
   * @author Mr.zheng
   * @Description visuaTempletTree 可视化模板接口
   * @Date 17:49 2018/8/23
   * @Param [templet]
   * @return com.platform.common.domain.result.ResultDataStruct<java.util.List<com.hxkj.domain.po.TemplteTree>>
   **/
    @RequestMapping(value = "/templet/visuaTempletTree", method = RequestMethod.POST,consumes = "application/json;charset=UTF-8")
    ResultDataStruct<List<TemplteTree>> visuaTempletTree(@RequestBody Templet templet) throws Exception;
}
